<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>伪元素</title>
    <style type="text/css">
        a::after {
            content: "-百度文库";
        }

        a[href$="doc"]::before {
            content: url("./../icon/word.png");
        }

        a[href$="pdf"]::before {
            content: url("./../icon/word.png");
        }

        a[href$="html"]::before {
            content: url("./../icon/word.png");
        }

        a[href$="xls"]::before {
            content: url("./../icon/word.png");
        }

    </style>
</head>
<body>
<div><a href="1.doc">文件名称：</a></div>
<div><a href="2.pdf">文件名称：</a></div>
<div><a href="3.py">文件名称：</a></div>
<div><a href="4.html">文件名称：</a></div>
<div><a href="5.ppt">文件名称：</a></div>
<div><a href="7.xls">文件名称：</a></div>
</body>
</html>